package com.gxa.system_setting.controller;

import com.gxa.common.R;
import com.gxa.common.entity.system_settings.Dropdown;
import com.gxa.system_setting.service.DropdownService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DropdownController {

    @Autowired
    private DropdownService dropdownService;

    //分页
    @GetMapping("/DropdownList")
    public R DropdownList(Integer currentPage,Integer pageSize){
        return dropdownService.DropdownList(currentPage,pageSize);
    }

    //编辑
    @PostMapping("/updateDropdown")
    public R updateDropdown(@RequestBody Dropdown dropdown){
         return  dropdownService.updateDropdown(dropdown);
    }
    //禁用/启用
    @GetMapping("/stopOrUseDropdown")
    public R stopOrUseDropdown(Long dropdownId,Long flag){
        return dropdownService.stopOrUseDropdown(dropdownId,flag);
    }
    //条件查询
    @PostMapping("/selectDropdownByConditions")
    public R selectDropdownByConditions(@RequestBody Dropdown dropdown){
        return dropdownService.selectDropdownByConditions(dropdown);
    }
}
